        <!DOCTYPE html>
        <html>
        <head>
                <meta charset="utf-8">
        <title>Joint class / box2d Library / Dart Documentation</title>
        <link rel="stylesheet" type="text/css"
            href="../styles.css">
        <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800" rel="stylesheet" type="text/css">
        <link rel="shortcut icon" href="../favicon.ico">
        
        </head>
        <body data-library="box2d" data-type="Joint">
        <div class="page">
        <div class="header">
          <a href="../index.html"><div class="logo"></div></a>
          <a href="../index.html">Dart Documentation</a>
         &rsaquo; <a href="../box2d.html">box2d</a> &rsaquo; <a href="../box2d/Joint.html">Joint</a>        <div id="search-box">
          <input type="search" name="q" id="q" autocomplete="off"
              class="search-input" placeholder="Search API">
        </div>
        
      </div>
      <div class="drop-down" id="drop-down"></div>
      
        <div class="nav">
        
</div>
<div class="content">
        <h2><strong>Joint</strong>
          class
        </h2>
        
<button id="show-inherited" class="show-inherited">Hide inherited</button>
<div class="doc">
<pre class="source">
class Joint {
 int type;

 Joint _prev;
 Joint _next;

 JointEdge edgeA;
 JointEdge edgeB;

 Body bodyA;
 Body bodyB;

 bool islandFlag;

 bool collideConnected;

 Object userData;

 // Cache here per time step to reduce cache misses.
 final vec2 localCenterA;
 final vec2 localCenterB;

 num invMassA;
 num invIA;
 num invMassB;
 num invIB;

 Joint(JointDef def) :
   type = def.type,
   _prev = null,
   _next = null,
   bodyA = def.bodyA,
   bodyB = def.bodyB,
   collideConnected = def.collideConnected,
   islandFlag = false,
   userData = def.userData,

   localCenterA = new vec2.zero(),
   localCenterB = new vec2.zero(),
   edgeA = new JointEdge(),
   edgeB = new JointEdge() { }

 // TODO(dominich): use 'is' to create the right type of Joint and remove the
 // *Def.type.
 factory Joint.create(World argWorld, JointDef def) {
   switch(def.type){
     case JointType.MOUSE:
       throw new UnimplementedError();
       //  return new MouseJoint(def);
     case JointType.DISTANCE:
       return new DistanceJoint(def);
     case JointType.PRISMATIC:
       throw new UnimplementedError();
       //  return new PrismaticJoint(def);
     case JointType.REVOLUTE:
       return new RevoluteJoint(def);
     case JointType.WELD:
       throw new UnimplementedError();
       //return new WeldJoint(def);
     case JointType.FRICTION:
       return new FrictionJoint(def);
     case JointType.LINE:
       throw new UnimplementedError();
       //return new LineJoint(def);
     case JointType.GEAR:
       throw new UnimplementedError();
       //return new GearJoint(def);
     case JointType.PULLEY:
       throw new UnimplementedError();
       //return new PulleyJoint(def);
     case JointType.CONSTANT_VOLUME:
       return new ConstantVolumeJoint(argWorld, def);
   }
   return null;
 }

 static void destroy(Joint joint) {
   joint.destructor();
 }

 /** Get the anchor point on bodyA in world coordinates. */
 void getAnchorA(vec2 argOut) { }

 /** Get the anchor point on bodyB in world coordinates. */
 void getAnchorB(vec2 argOut) { }

 /** Get the reaction force on body2 at the joint anchor in Newtons. */
 void getReactionForce(num inv_dt, vec2 argOut) { }

 /** Get the reaction torque on body2 in N*m. */
 num getReactionTorque(num inv_dt) { }

 /** Short-cut function to determine if either body is inactive. */
 bool get active =&gt; bodyA.active &amp;&amp; bodyB.active;

 void initVelocityConstraints(TimeStep time_step) { }

 void solveVelocityConstraints(TimeStep time_step) { }

 /** This returns true if the position errors are within tolerance. */
 bool solvePositionConstraints(num baumgarte) { }

 /** Override to handle destruction of joint. */
 void destructor() { }
}
</pre>
</div>
<h3>Subclasses</h3>
<p>
<span class="type-box"><span class="icon-class"></span><a href="../box2d/ConstantVolumeJoint.html">ConstantVolumeJoint</a></span>, <span class="type-box"><span class="icon-class"></span><a href="../box2d/DistanceJoint.html">DistanceJoint</a></span>, <span class="type-box"><span class="icon-class"></span><a href="../box2d/FrictionJoint.html">FrictionJoint</a></span>, <span class="type-box"><span class="icon-class"></span><a href="../box2d/RevoluteJoint.html">RevoluteJoint</a></span></p>
<div>
<h3>Static Methods</h3>
<div class="method"><h4 id="destroy">
<button class="show-code">Code</button>
void <strong>destroy</strong>(<a href="../box2d/Joint.html">Joint</a> joint) <a class="anchor-link" href="#destroy"
              title="Permalink to Joint.destroy">#</a></h4>
<div class="doc">
<pre class="source">
static void destroy(Joint joint) {
 joint.destructor();
}
</pre>
</div>
</div>
</div>
<div>
<h3>Constructors</h3>
<div class="method"><h4 id="Joint">
<button class="show-code">Code</button>
new <strong>Joint</strong>(<a href="../box2d/JointDef.html">JointDef</a> def) <a class="anchor-link" href="#Joint"
              title="Permalink to Joint.Joint">#</a></h4>
<div class="doc">
<pre class="source">
Joint(JointDef def) :
 type = def.type,
 _prev = null,
 _next = null,
 bodyA = def.bodyA,
 bodyB = def.bodyB,
 collideConnected = def.collideConnected,
 islandFlag = false,
 userData = def.userData,

 localCenterA = new vec2.zero(),
 localCenterB = new vec2.zero(),
 edgeA = new JointEdge(),
 edgeB = new JointEdge() { }
</pre>
</div>
</div>
<div class="method"><h4 id="Joint.create">
<button class="show-code">Code</button>
factory <strong>Joint.create</strong>(<a href="../box2d/World.html">World</a> argWorld, <a href="../box2d/JointDef.html">JointDef</a> def) <a class="anchor-link" href="#Joint.create"
              title="Permalink to Joint.Joint.create">#</a></h4>
<div class="doc">
<pre class="source">
factory Joint.create(World argWorld, JointDef def) {
 switch(def.type){
   case JointType.MOUSE:
     throw new UnimplementedError();
     //  return new MouseJoint(def);
   case JointType.DISTANCE:
     return new DistanceJoint(def);
   case JointType.PRISMATIC:
     throw new UnimplementedError();
     //  return new PrismaticJoint(def);
   case JointType.REVOLUTE:
     return new RevoluteJoint(def);
   case JointType.WELD:
     throw new UnimplementedError();
     //return new WeldJoint(def);
   case JointType.FRICTION:
     return new FrictionJoint(def);
   case JointType.LINE:
     throw new UnimplementedError();
     //return new LineJoint(def);
   case JointType.GEAR:
     throw new UnimplementedError();
     //return new GearJoint(def);
   case JointType.PULLEY:
     throw new UnimplementedError();
     //return new PulleyJoint(def);
   case JointType.CONSTANT_VOLUME:
     return new ConstantVolumeJoint(argWorld, def);
 }
 return null;
}
</pre>
</div>
</div>
</div>
<div>
<h3>Properties</h3>
<div class="field"><h4 id="active">
<button class="show-code">Code</button>
final bool         <strong>active</strong> <a class="anchor-link"
            href="#active"
            title="Permalink to Joint.active">#</a>
        </h4>
        <div class="doc">
<p>Short-cut function to determine if either body is inactive. </p>
<pre class="source">
bool get active =&gt; bodyA.active &amp;&amp; bodyB.active;
</pre>
</div>
</div>
<div class="field"><h4 id="bodyA">
<button class="show-code">Code</button>
<a href="../box2d/Body.html">Body</a>         <strong>bodyA</strong> <a class="anchor-link"
            href="#bodyA"
            title="Permalink to Joint.bodyA">#</a>
        </h4>
        <div class="doc">
<pre class="source">
bodyA
</pre>
</div>
</div>
<div class="field"><h4 id="bodyB">
<button class="show-code">Code</button>
<a href="../box2d/Body.html">Body</a>         <strong>bodyB</strong> <a class="anchor-link"
            href="#bodyB"
            title="Permalink to Joint.bodyB">#</a>
        </h4>
        <div class="doc">
<pre class="source">
bodyB
</pre>
</div>
</div>
<div class="field"><h4 id="collideConnected">
<button class="show-code">Code</button>
bool         <strong>collideConnected</strong> <a class="anchor-link"
            href="#collideConnected"
            title="Permalink to Joint.collideConnected">#</a>
        </h4>
        <div class="doc">
<pre class="source">
collideConnected
</pre>
</div>
</div>
<div class="field"><h4 id="edgeA">
<button class="show-code">Code</button>
<a href="../box2d/JointEdge.html">JointEdge</a>         <strong>edgeA</strong> <a class="anchor-link"
            href="#edgeA"
            title="Permalink to Joint.edgeA">#</a>
        </h4>
        <div class="doc">
<pre class="source">
edgeA
</pre>
</div>
</div>
<div class="field"><h4 id="edgeB">
<button class="show-code">Code</button>
<a href="../box2d/JointEdge.html">JointEdge</a>         <strong>edgeB</strong> <a class="anchor-link"
            href="#edgeB"
            title="Permalink to Joint.edgeB">#</a>
        </h4>
        <div class="doc">
<pre class="source">
edgeB
</pre>
</div>
</div>
<div class="field"><h4 id="invIA">
<button class="show-code">Code</button>
num         <strong>invIA</strong> <a class="anchor-link"
            href="#invIA"
            title="Permalink to Joint.invIA">#</a>
        </h4>
        <div class="doc">
<pre class="source">
invIA
</pre>
</div>
</div>
<div class="field"><h4 id="invIB">
<button class="show-code">Code</button>
num         <strong>invIB</strong> <a class="anchor-link"
            href="#invIB"
            title="Permalink to Joint.invIB">#</a>
        </h4>
        <div class="doc">
<pre class="source">
invIB
</pre>
</div>
</div>
<div class="field"><h4 id="invMassA">
<button class="show-code">Code</button>
num         <strong>invMassA</strong> <a class="anchor-link"
            href="#invMassA"
            title="Permalink to Joint.invMassA">#</a>
        </h4>
        <div class="doc">
<pre class="source">
invMassA
</pre>
</div>
</div>
<div class="field"><h4 id="invMassB">
<button class="show-code">Code</button>
num         <strong>invMassB</strong> <a class="anchor-link"
            href="#invMassB"
            title="Permalink to Joint.invMassB">#</a>
        </h4>
        <div class="doc">
<pre class="source">
invMassB
</pre>
</div>
</div>
<div class="field"><h4 id="islandFlag">
<button class="show-code">Code</button>
bool         <strong>islandFlag</strong> <a class="anchor-link"
            href="#islandFlag"
            title="Permalink to Joint.islandFlag">#</a>
        </h4>
        <div class="doc">
<pre class="source">
islandFlag
</pre>
</div>
</div>
<div class="field"><h4 id="localCenterA">
<button class="show-code">Code</button>
final <a href="../vector_math/vec2.html">vec2</a>         <strong>localCenterA</strong> <a class="anchor-link"
            href="#localCenterA"
            title="Permalink to Joint.localCenterA">#</a>
        </h4>
        <div class="doc">
<pre class="source">
localCenterA
</pre>
</div>
</div>
<div class="field"><h4 id="localCenterB">
<button class="show-code">Code</button>
final <a href="../vector_math/vec2.html">vec2</a>         <strong>localCenterB</strong> <a class="anchor-link"
            href="#localCenterB"
            title="Permalink to Joint.localCenterB">#</a>
        </h4>
        <div class="doc">
<pre class="source">
localCenterB
</pre>
</div>
</div>
<div class="field"><h4 id="type">
<button class="show-code">Code</button>
int         <strong>type</strong> <a class="anchor-link"
            href="#type"
            title="Permalink to Joint.type">#</a>
        </h4>
        <div class="doc">
<pre class="source">
type
</pre>
</div>
</div>
<div class="field"><h4 id="userData">
<button class="show-code">Code</button>
Object         <strong>userData</strong> <a class="anchor-link"
            href="#userData"
            title="Permalink to Joint.userData">#</a>
        </h4>
        <div class="doc">
<pre class="source">
userData
</pre>
</div>
</div>
</div>
<div>
<h3>Methods</h3>
<div class="method"><h4 id="destructor">
<button class="show-code">Code</button>
void <strong>destructor</strong>() <a class="anchor-link" href="#destructor"
              title="Permalink to Joint.destructor">#</a></h4>
<div class="doc">
<p>Override to handle destruction of joint. </p>
<pre class="source">
void destructor() { }
</pre>
</div>
</div>
<div class="method"><h4 id="getAnchorA">
<button class="show-code">Code</button>
void <strong>getAnchorA</strong>(<a href="../vector_math/vec2.html">vec2</a> argOut) <a class="anchor-link" href="#getAnchorA"
              title="Permalink to Joint.getAnchorA">#</a></h4>
<div class="doc">
<p>Get the anchor point on bodyA in world coordinates. </p>
<pre class="source">
void getAnchorA(vec2 argOut) { }
</pre>
</div>
</div>
<div class="method"><h4 id="getAnchorB">
<button class="show-code">Code</button>
void <strong>getAnchorB</strong>(<a href="../vector_math/vec2.html">vec2</a> argOut) <a class="anchor-link" href="#getAnchorB"
              title="Permalink to Joint.getAnchorB">#</a></h4>
<div class="doc">
<p>Get the anchor point on bodyB in world coordinates. </p>
<pre class="source">
void getAnchorB(vec2 argOut) { }
</pre>
</div>
</div>
<div class="method"><h4 id="getReactionForce">
<button class="show-code">Code</button>
void <strong>getReactionForce</strong>(num inv_dt, <a href="../vector_math/vec2.html">vec2</a> argOut) <a class="anchor-link" href="#getReactionForce"
              title="Permalink to Joint.getReactionForce">#</a></h4>
<div class="doc">
<p>Get the reaction force on body2 at the joint anchor in Newtons. </p>
<pre class="source">
void getReactionForce(num inv_dt, vec2 argOut) { }
</pre>
</div>
</div>
<div class="method"><h4 id="getReactionTorque">
<button class="show-code">Code</button>
num <strong>getReactionTorque</strong>(num inv_dt) <a class="anchor-link" href="#getReactionTorque"
              title="Permalink to Joint.getReactionTorque">#</a></h4>
<div class="doc">
<p>Get the reaction torque on body2 in N*m. </p>
<pre class="source">
num getReactionTorque(num inv_dt) { }
</pre>
</div>
</div>
<div class="method"><h4 id="initVelocityConstraints">
<button class="show-code">Code</button>
void <strong>initVelocityConstraints</strong>(<a href="../box2d/TimeStep.html">TimeStep</a> time_step) <a class="anchor-link" href="#initVelocityConstraints"
              title="Permalink to Joint.initVelocityConstraints">#</a></h4>
<div class="doc">
<pre class="source">
void initVelocityConstraints(TimeStep time_step) { }
</pre>
</div>
</div>
<div class="method"><h4 id="solvePositionConstraints">
<button class="show-code">Code</button>
bool <strong>solvePositionConstraints</strong>(num baumgarte) <a class="anchor-link" href="#solvePositionConstraints"
              title="Permalink to Joint.solvePositionConstraints">#</a></h4>
<div class="doc">
<p>This returns true if the position errors are within tolerance. </p>
<pre class="source">
bool solvePositionConstraints(num baumgarte) { }
</pre>
</div>
</div>
<div class="method"><h4 id="solveVelocityConstraints">
<button class="show-code">Code</button>
void <strong>solveVelocityConstraints</strong>(<a href="../box2d/TimeStep.html">TimeStep</a> time_step) <a class="anchor-link" href="#solveVelocityConstraints"
              title="Permalink to Joint.solveVelocityConstraints">#</a></h4>
<div class="doc">
<pre class="source">
void solveVelocityConstraints(TimeStep time_step) { }
</pre>
</div>
</div>
</div>
        </div>
        <div class="clear"></div>
        </div>
        <div class="footer">
          
        </div>
        <script async src="../client-live-nav.js"></script>
        </body></html>
        
